import React from 'react';
import {GlobalStyled} from "./style";
import Header from './common/header'
import Home from './pages/home';
import Detail from './pages/detail/loadable'
import Login from './pages/login'
import Write from './pages/write'
//阿里矢量图标库的相关文件
import {Iconfont} from './statics/iconfont/iconfont'
//Provider把store中的数据都提供给Provider内的组件
import {Provider} from 'react-redux';
import store from './store'
//第三方路由
import {BrowserRouter,Route} from "react-router-dom";

class App extends React.Component{
  render(){
      return(
          <Provider store={store}>
              <GlobalStyled/>
               <Iconfont/>
              <BrowserRouter>
                  <Header/>
                  <Route path='/'exact component={Home}></Route>
                     {/* <Route path='/detail'exact component={Detail}></Route>*/}
                      <Route path='/write'exact component={Write}></Route>
                      <Route path='/login'exact component={Login}></Route>
                      {/*动态路由*/}
                      <Route path='/detail/:id'exact component={Detail}></Route>
              </BrowserRouter>
          </Provider>
      )
  }
}

export default App;
